<%@ page language="java"
	import="com.gy.sams.entity.*,com.gy.sams.dao.*,com.gy.sams.dao.impl.*"  
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
	//String id=request.getParameter("uId");
	String name=request.getParameter("uName");
	String pass=request.getParameter("uPass");
	String role=request.getParameter("uRole");
	User user=new User();
	//user.setId(id);
	user.setUname(name);
	user.setUpass(pass);
	user.setRole(role); 
	IUserDao userDao=new UserDaoImpl();
	user=userDao.findUser(user);
	if(user!=null){
		session.setAttribute("user", user);//存储
		if(role.equalsIgnoreCase("0") ){
			out.print("<script type='text/javascript'>alert('登陆成功！');location.replace('../atableScore.jsp')</script>");
		}else{
			out.print("<script type='text/javascript'>alert('登陆成功！');location.replace('../tableScore.jsp')</script>");
		}
		
		//response.sendRedirect("../listMsg.jsp");
	}else{
		out.print("<script type='text/javascript'>alert('登录失败！');location.replace('../index.jsp')</script>");
		//response.sendRedirect("../index.jsp");
	}
%>